public class weapon {
    private String type;
    private int life;// 生命值
	private int attack;// 攻击力
	private int defend;// 防御力
    public void setType(String type){
        this.type = type;
    }
    public String getType(){
        return type;
    }
    public int getLife() {
		return life;
	}
	public void setLife(int life) {
		this.life = life;
	}
    public int getAttack() {
		return attack;
	}
	public void setAttack(int attack) {
		this.attack = attack;
	}
	public int getDefend() {
		return defend;
	}
	public void setDefend(int defend) {
		this.defend = defend;
	}
	public void equip(Player h){
		h.setWeapon(type);
		h.setLife(h.getLife() + life);
		h.setAttack(h.getAttack()+attack);
		h.setDefend(h.getDefend()+defend);
	}
	public void unload(Player h){
		h.setLife(h.getLife() - life);
		h.setAttack(h.getAttack() - attack);
		h.setDefend(h.getDefend() - defend);
	}
}
